package com.ruoyi.cfuser.api.factory;


import com.ruoyi.cfuser.api.domain.CfUser;
import com.ruoyi.cfuser.api.service.RemoteCfUserService;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * 用户服务降级处理
 * 
 * @author ruoyi
 */
@Component
public class RemoteCfUserFallbackFactory implements FallbackFactory<RemoteCfUserService>
{
    private static final Logger log = LoggerFactory.getLogger(RemoteCfUserFallbackFactory.class);

    @Override
    public RemoteCfUserService create(Throwable throwable)
    {
        log.error("用户端cf_user表远程调用失败:{}", throwable.getMessage());
        return new RemoteCfUserService()
        {


            @Override
            public AjaxResult getInfo(Long id) {
                System.out.println("用户端cf_user表远程调用失败:{}--getinfo()");
                return null;
            }

            @Override
            public TableDataInfo list(CfUser cfUser) {
                System.out.println("用户端cf_user表远程调用失败:{}--list()");
                return null;
            }

        };
    }
}
